home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 25 / AMIGAplus Sonderheft 25 (2000)(Falke)(DE)(Track 1 of 4)[!].iso / PublicDomain / Anwendungen / ActXDx / ActXDx.c < prev    next >
C/C++ Source or Header  |  1997-03-02  |  2KB  |  76 lines

  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <intuition/intuition.h>
  4. #include <pragma/dos_lib.h>
  5. #include <pragma/icon_lib.h>
  6. #include <pragma/exec_lib.h>
  7. #include <pragma/intuition_lib.h>
  8.  
  9. #include <wbstartup.h>
  10.  
  11. int EasyReq(struct Window *,char *,char *, char *);
  12.  
  13. static unsigned char *version = "$VER: ActXDx 1.0  ("__DATE__") by Jens Weyer";
  14.  
  15. struct Library *IconBase = NULL;
  16. struct DiskObject *Icon = NULL;
  17. char Unit[3];
  18. char Exe[6];
  19. BOOL Quiet = FALSE;
  20.  
  21. void main(int argc, char *argv[])
  22. {
  23.   IconBase = OpenLibrary("icon.library",36L);
  24.   if (IconBase != NULL)
  25.   {
  26.     Icon = GetDiskObject(argv[0]);
  27.     if (Icon != NULL)
  28.     {
  29.       char *Type;
  30.       if (Type = FindToolType((UBYTE **)Icon->do_ToolTypes,"UNIT"))
  31.       {
  32.         strcpy(Unit,Type);
  33.         strcpy(Exe,"XD");
  34.         strcat(Exe,Unit);
  35.         strcat(Exe,":");
  36.         Execute(Exe,0,0);
  37.         if (Type = FindToolType((UBYTE **)Icon->do_ToolTypes,"QUIET"))
  38.         {
  39.           Quiet = TRUE;
  40.         }
  41.         else
  42.         {
  43.           Quiet = FALSE;
  44.         }
  45.         FreeDiskObject(Icon);
  46.         CloseLibrary(IconBase);
  47.         if (Quiet == FALSE)
  48.         {
  49.           EasyReq(NULL,"ActXDx - Message","ActXDx v1.0\nCopyright (c)1997 by Jens Weyer\n\nSpecified Unit should be\nactivated in a few seconds !","Ok");
  50.         }
  51.       }
  52.       else
  53.       {
  54.         printf("No unit is specified !\n");
  55.       }
  56.     }
  57.     else
  58.     {
  59.       printf("Unable to find my icon !\n");
  60.     }
  61.   }
  62.   else
  63.   {
  64.     printf("Unable to open Icon.library v36++\n");
  65.   }
  66. }
  67.  
  68. int EasyReq(struct Window *Wnd,char *Titel,char *Text, char *Gads)
  69. {
  70.   struct EasyStruct    ez={sizeof(struct EasyStruct),0,Titel,Text,Gads};
  71.  
  72.   int Result = EasyRequestArgs(Wnd,&ez,0,NULL);
  73.  
  74.   return( Result );
  75. }
  76.